<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>用户登录</title>
    <link rel="stylesheet" type="text/css" media="all"
          href="/webjars/bootstrap/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/css/bootstrap.min.css}" />
    <style>
        body{
            margin-left:auto;
            margin-right:auto;
            margin-TOP:100PX;
            width:20em;
        }
    </style>
</head>
<body>
<div class="container">
    <form th:action="@{/login}" method="POST">
        <div class="input-group">
            <span th:text="${message}" ></span>
        </div>
        <br />
        <!--用户名输入框-->
        <div class="input-group">

            <input id="loginName" name="loginName" type="text" class="form-control" placeholder="用户名"  />
        </div>
        <br />
        <!--密码输入框-->
        <div class="input-group">

            <input id="password" name="password" type="text" class="form-control" placeholder="密码"  />
        </div>
        <br />
        <div th:if="${showVrifyCode}" class=" row" style="padding-bottom:10px;">
            <div class="col-md-5"><img src="/kaptcha" id="vrifyImage"/></div>

            <div class="col-md-7">
                <input id="vrifyCode" name="vrifyCode" type="text" class="form-control"  placeholder="验证码"  />
            </div>

        </div>

        <!--记住我输入框-->
        <div class="checkbox">
            <label>
                <input id="rememberMe" name="rememberMe" type="checkbox" /> Remember me
            </label>
        </div>
        <br />

        <!--登陆按钮,包括颜色控制-->
        <button type="submit" style="width:280px;" class="btn btn-default">登 录</button>
    </form>
</div>
<script th:src="@{/webjars/jquery/jquery.min.js}"></script>
<script th:src="@{/webjars/bootstrap/js/bootstrap.min.js}"></script>
<script type="text/javascript">
    $(function () {
        if (window.parent.window != window) {
            window.top.location = "/login";
        }
        $('#vrifyImage').click(function (img) {
            $(this).attr('src','/kaptcha');
        })
    });

</script>
</body>
</html>